﻿using ATHTaskList2012.Mailers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ATHTaskList2012.Security;
using FluentNHibernate.Cfg.Db;
using FluentNHibernate.Cfg;
using NHibernate;
using ATHTaskList2012.Entities;

namespace ATHTaskList2012.Controllers
{
    public class HomeController : Controller
    {
        private IUserMailer _userMailer = new UserMailer();
        public IUserMailer UserMailer
        {
            get { return _userMailer; }
            set { _userMailer = value; }
        }

        public ActionResult Index()
        {
            ViewBag.Message = "ATH TaskList 2012";

            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Tasklist";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Contact page.";

            return View();
        }


        [OpenIdAuthorize]
        public ActionResult SendMessage()
        {
            UserMailer.ForgottenTask().Send(); //Send() extension method: using Mvc.Mailer
            return RedirectToAction("Index");
        }
    }
}
